<{include file="../common/header.tpl"}>
<table width="100%" border="0" cellspacing="0">
 <tr>
    <td width="13%" valign="top">
            <{include file="../common/left.tpl"}>
    </td>
    <td width="87%" valign="top">
					
        <table width="100%" border="0" cellspacing="0">
          <tr>
                <td>
                    <div class="subnav">
                    <form name="form1" id="form1" method="get" action="/webadmin/project/list">
                    <div class="explain-col">
                           项目名称：<input type="text" value="<{$project_name}>" class="input-text" name="project_name">
                           状态：<select name="current_status" autocomplete="off">
                               <option value="0">所有</option>
                               <{foreach $status as $key => $val}>
                               <{if $key!=0}><option value="<{$key}>" <{if $current_status==$key}>selected="selected"<{/if}>><{$val}></option><{/if}>
                               <{/foreach}>
                           </select>
                                           <input type="submit" value="搜索" class="button" name="dosubmit"> 
                    </div>
                    </form>
                      <div class="content-menu ib-a blue line-x"> 
                      <a href="javascript:;" class="on"><em>项目信息管理</em></a><span>|</span>
                      <a href="/webadmin/project/add"><em>添加项目</em></a>
                      </div>
                    </div>

                        <div class="pad_10">
                          <div class="table-list">
                          <table width="100%">
                                <thead>
                                  <tr>
                                        <th width="96">项目编号</th>
                                        <th width="517" align="left">项目名称</th>
                                        <th width="82">问卷数量</th>
                                        <th width="150">更新时间</th>
                                        <th width="40">状态</th>
                                        <th width="200">管理操作</th>
                                  </tr>
                                </thead>
                                <tbody>
                                  <{foreach $list as $key => $val}>
                                  <tr id="project_<{$val.project_id}>">
                                        <td align="center"><{$val.project_num}></td>
                                        <td align="left">
                                                <a href="/webadmin/question/list?project_id=<{$val.project_id}>"> <span style=""><{$val.project_name}></span></a> 
                                        </td>
                                        <td align="center"><{if $val.question_num}><{$val.question_num}><{else}>0<{/if}></td>
                                        <td align="center"><{$val.update_time|date_format:"%Y-%m-%d %H:%M:%S"}></td>
                                        <td><{$status[$val.status]}></td>
                                        <td align="center">
                                            <a href="/webadmin/project/view?project_id=<{$val.project_id}>">预览</a> | 
                                            <a href="/webadmin/question/add?project_id=<{$val.project_id}>">添加新问卷</a> | 
                                            <a href="/webadmin/project/edit?project_id=<{$val.project_id}>">修改</a> | 
                                            <a href="javascript:;" name="delete" rel="<{$val.project_id}>">删除</a>
                                        </td>
                                  </tr>
                                  <{/foreach}>
                                </tbody>
                          </table>
                                <div style="float:right;"><{$page}></div>
                          </div>
                        </div>
                </td>
          </tr>
        </table>
    	</td>
 </tr>
</table>
<script type="text/javascript">
$(document).ready(function($) {
	$('a[name="delete"]').click(function() {
		var id = $(this).attr('rel');
		if (id == ''){
			return false;
		}
		$or = confirm('你确定要删除吗？');
		if($or){
	  		$.ajax({
	 			 type:'post',
	 			 async : true,
				 dataType:"json",
				 data: {'project_id':id},
	 			 url:'/webadmin/project/delete',
	 			 success:function(data){
	 				if(data.status==1){
                                            $('#project_'+id).remove();
					}
                                        alert(data.note);
	 			 }
	 		});
	  	}
	});
});
</script>
<{include file="../common/footer.tpl"}>